import './public-path';
import Vue from 'vue';
import App from './App.vue';
import { routes } from './router';
import store from './store';
import actions from './share/actions';
import VueRouter from 'vue-router';
import qkhook from 'qkhook';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

// 全局样式
import './styles/global.css';

// 取色器vcolorpicker
import vcolorpicker from 'vcolorpicker';
// 取色器vue-color
import { Photoshop } from 'vue-color';

// 代码编辑器
import VueCodemirror from 'vue-codemirror';
// import base style
import 'codemirror/lib/codemirror.css';

Vue.use(Photoshop);
Vue.use(vcolorpicker);
Vue.use(VueCodemirror);

Vue.use(ElementUI);
window.Vue = Vue;
const hook = qkhook({
  actions,
  Vue,
  VueRouter,
  App,
  store,
  routes
});
// 独立运行时
if (!window.__POWERED_BY_QIANKUN__) {
  const router = new VueRouter({ routes });
  new Vue({
    router,
    store,
    render: (h) => h(App)
  }).$mount('#app');
}

export const bootstrap = hook.bootstrap;
export const mount = hook.mount;
export const unmount = hook.unmount;
